import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue'),
   
  },
  {
    path: '/tologin',
    name: 'Tologin',
    component: () => import(/* webpackChunkName: "Tologin" */ '../components/ToLogin.vue'),
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import(/* webpackChunkName: "Tologin" */ '../views/Index.vue'),
  },
  {
    path: '/order',
    name: 'Order',
    component: () => import(/* webpackChunkName: "Tologin" */ '../views/Order.vue'),
  },
  {
    path: '/surefahuo/:serialNo',
    name: 'Surefahuo',
    component: () => import(/* webpackChunkName: "surefahuo" */ '../components/Order/SureFaHuo.vue'),
  },
  {
    path: '/pingfen2/:serialNo',
    name: 'Pingfen',
    component: () => import(/* webpackChunkName: "pingfen" */ '../components/Order/pingfeng2.vue'),
  },
  //个人中心
  {
    path: '/personal',
    name: 'Personal',
    component: () => import(/* webpackChunkName: "personal" */ '../views/Personal.vue'),
  },
  {
    path: '/personalinfo',
    name: 'Personalinfo',
    component: () => import(/* webpackChunkName: "personalinfo" */ '../components/Personal/Personalinfo.vue'),
  },
  {
    path: '/versioninfo',
    name: 'Versioninfo',
    component: () => import(/* webpackChunkName: "versioninfo" */ '../components/Personal/Version.vue'),
  },
  {
    path: '/newscenter',
    name: 'Newscenter',
    component: () => import(/* webpackChunkName: "newscenter" */ '../views/NewsCenter.vue'),
  },
  {
    path: '/newsdetail/:id',
    name: 'Newsdetail',
    component: () => import(/* webpackChunkName: "newsdetail" */ '../components/NewsCenter/NewsDetail.vue'),
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import(/* webpackChunkName: "newsdetail" */ '../views/Home.vue'),
  },
  //我的客户
  {
    path: '/mykehu/:id',
    name: 'Mykehu',
    component: () => import(/* webpackChunkName: "mykehu" */ '../views/Mykehu.vue'),
  },
  {
    path: '/kehulist',
    name: 'Kehulist',
    component: () => import(/* webpackChunkName: "kehulist" */ '../views/KehuList.vue'),
  },
  {
    path: '/xiangqing/:id',
    name: 'Xiangqing',
    component: () => import(/* webpackChunkName: "xiangqing" */ '../components/Mykehu/Kehuxiangqing.vue'),
  },
  {
    path: '/xiugai',
    name: 'Xiugai',
    component: () => import(/* webpackChunkName: "xiugai" */ '../components/Mykehu/Xiugai.vue'),
  },
  //客户关怀
  {
    path: '/kehuguanhuai',
    name: 'Kehuguanhuai',
    component: () => import(/* webpackChunkName: "xiugai" */ '../views/KehuGuanhuai.vue'),
  },

  //定期回访
  {
    path: '/huifang',
    name: 'Huifang',
    component: () => import(/* webpackChunkName: "xiugai" */ '../components/Huifang/Huifang.vue'),
  },

  //新增拜访
  {
    path: '/newadd',
    name: 'Newadd',
    component: () => import(/* webpackChunkName: "newadd" */ '../components/Huifang/Newadd.vue'),
  },




  
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
